import "./tag.scss";
import classNames from "classnames";
type TagProps = {
  children: string | React.ReactElement;
  className?: string;
  onClick?: () => void;
};

export const Tag = ({
  children,
  className = "",
  onClick,
  ...rest
}: TagProps): React.ReactElement => {
  const tagClassName = (): string => {
    return classNames("dashboard_tag", className);
  };

  const handleClick = (): void => {
    onClick?.();
  };
  return (
    <>
      <div className={tagClassName()} {...rest} onClick={handleClick}>
        <span>{children}</span>
      </div>
    </>
  );
};
